﻿using System;
using System.Collections.Generic;
using System.Text;

namespace X3DLib
{
    public class Inline:X3DObject
    {
        private string Load;

        public string load
        {
            get { return Load; }
            set { Load = value; }
        }
        private string Url;

        public string url
        {
            get { return Url; }
            set { Url = value; }
        }
    
        public Inline():base()
        {
            this.load = "";
            this.url = "";
        }

        public Inline(string url,string load)
            : base()
        {
            this.load = load;
            this.url = url;
        }

        public override string getAttrs()
        {
            return "DEF|" + this.DEF + "|string,"
                    + "USE|" + this.USE + "|string,"
                    + "size|" + this.url + "|string,"
                    + "size|" + this.load==null?"true":"false" + "|bool";
        }
        public override void setAttrs(string attrs)
        {
            string[][] temp = X3DString.getArrayByAttrs(attrs);
            for (int i = 0; i < temp.Length; i++)
            {
                switch (temp[i][0])
                {
                    case "DEF":
                        this.DEF = temp[i][1];
                        break;
                    case "USE":
                        this.USE = temp[i][1];
                        break;
                    case "url":
                        this.url = temp[i][1];
                        break;
                    case "load":
                        this.load = temp[i][1];
                        break;
                }
            }
        }

    }
}
